<style>
    .col-tags span.tag {
        color: #409eff;
    }
</style>
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="panel-heading">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#basic" data-toggle="tab">基础信息</a></li>
            <li><a href="#sku" data-toggle="tab">库存/规格</a></li>
        </ul>
    </div>
    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div id="basic" class="tab-pane fade active in">

                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Type_id')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-type_id" data-rule="required" data-source="fzdc/goods/type/index"
                               class="form-control selectpage" name="row[type_id]" type="text" value="" data-params='{"custom[store_ids]":["in",<?php echo json_encode($store_ids); ?>]}'>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-title" class="form-control" name="row[title]" type="text" value="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Tags')}:</label>
                    <div class="col-xs-12 col-sm-8 col-tags">
                        <input id="c-tags" class="form-control selectpage" data-source="fzdc/goods/type/tag"
                               name="row[tags]" type="text" value="">
                    </div>
                </div>
                <div class="form-group" style="display: none;">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Switch')}:</label>
                    <div class="col-xs-12 col-sm-8">

                        <input id="c-switch" name="row[switch]" type="hidden" value="0">
                        <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-switch"
                           data-yes="1" data-no="0">
                            <i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>
                        </a>
                    </div>
                </div>
                <div class="form-group" data-favisible="switch=0">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Store_ids')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-store_ids" data-rule="required" data-source="fzdc/store/store/index"
                               data-field="title" data-multiple="false" class="form-control selectpage"
                               name="row[store_ids]" type="text" value="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group">
                            <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="">
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-image" class="btn btn-danger faupload"
                                              data-input-id="c-image"
                                              data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"
                                              data-multiple="false" data-preview-id="p-image"><i
                                        class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose"
                                              data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i
                                        class="fa fa-list"></i> {:__('Choose')}</button></span>
                            </div>
                            <span class="msg-box n-right" for="c-image"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-image"></ul>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('详情图')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group">
                            <input id="c-images" class="form-control" size="50" name="row[images]" type="text" value="">
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-images" class="btn btn-danger faupload"
                                              data-input-id="c-images"
                                              data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"
                                              data-multiple="true" data-preview-id="p-images"><i
                                        class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose"
                                              data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i
                                        class="fa fa-list"></i> {:__('Choose')}</button></span>
                            </div>
                            <span class="msg-box n-right" for="c-images"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-images"></ul>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('详情')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <textarea id="c-json" class="form-control editor" rows="5" name="row[json]"
                                  cols="50"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('出货类型')}:</label>
                    <div class="col-xs-12 col-sm-8">

                        <div class="radio">
                            {foreach name="shipmentList" item="vo"}
                            <label for="row[shipment]-{$key|htmlentities}"><input id="row[shipment]-{$key|htmlentities}" name="row[shipment]"
                                                                     type="radio" value="{$key|htmlentities}" {in name="key"
                                                                     value="1" }checked{/in} /> {$vo|htmlentities}</label>
                            {/foreach}
                        </div>

                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('商品类型')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            {:build_radios('row[type]', ['1'=>__('单规格'), '2'=>__('多规格')])}
                        </div>
                </div>
                <div class="form-group" data-favisible="type=1">
                    <label class="control-label col-xs-12 col-sm-2">{:__('价格')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input type="text" class="form-control" id="price" name="row[price]" value="0" data-rule="required"/>
                        </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('State')}:</label>
                    <div class="col-xs-12 col-sm-8">

                        <div class="radio">
                            {foreach name="stateList" item="vo"}
                            <label for="row[state]-{$key|htmlentities}"><input id="row[state]-{$key|htmlentities}" name="row[state]" type="radio"
                                                                  value="{$key|htmlentities}" {in name="key" value="1" }checked{/in}
                                /> {$vo|htmlentities}</label>
                            {/foreach}
                        </div>

                    </div>
                </div>
                <div class="form-group">
                    <label for="weigh" class="control-label col-xs-12 col-sm-2">{:__('权重')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input type="text" class="form-control" id="weigh" name="row[weigh]" value="0" data-rule="required"/>
                    </div>
                </div>
            </div>
            <div class="tab-pane fade" id="sku">
                <div class="goods-spec-many form-grou">
                    {include file="/fzdc/goods/goods/sku" /}
                </div>
            </div>
        </div>

    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
